// 1. 导入mongoose
const mog = require('mongoose');
// 2. 连接数据库
mog.connect('mongodb://localhost/1208')
// 3. 创建连接回调 connection.on("open",callback)
mog.connection.on('open',()=>{
    console.log("连接成功");
})
mog.connection.on('error',()=>{
    console.log("连接失败");
})

module.exports = mog;
  